Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@noble/curves

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@noble/curves

Audited & minimal JS implementation of elliptic curve cryptography

  • 1.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2M
decreased by-21.75%
Maintainers
1
Weekly downloads
 
Created

What is @noble/curves?

The @noble/curves npm package is a library that provides a collection of elliptic curves, allowing for the implementation of cryptographic operations such as digital signatures and key agreement protocols. It is part of the noble family of cryptographic libraries, which are known for their focus on security, simplicity, and small bundle size.

What are @noble/curves's main functionalities?

Elliptic Curve Cryptography (ECC) Operations

This code demonstrates how to generate a private key, derive its corresponding public key, sign a message, and verify the signature using the P-256 elliptic curve. It showcases the basic cryptographic operations that can be performed with the @noble/curves package.

"use strict";
const curves = require('@noble/curves');
const { p256 } = curves;
async function main() {
  const privateKey = p256.utils.randomPrivateKey();
  const publicKey = p256.getPublicKey(privateKey);
  const message = new TextEncoder().encode('Hello, world!');
  const signature = await p256.sign(message, privateKey);
  const isValid = await p256.verify(signature, message, publicKey);
  console.log('Signature valid:', isValid);
}
main();

Other packages similar to @noble/curves

Keywords

FAQs

Package last updated on 03 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc